<script setup lang="ts">
import { onMounted } from 'vue'
import useStore from '@/stores'

const { homeStore } = useStore()

// // 弹窗
// const popFn = (src, isVideo, isYT) => {
//     config.isVideo = isVideo
//     config.isYT = isYT
//     if(isVideo) {
//         if(isYT) {
//             config.videoScript = src
//         } else {
//             config.videoSrc = src
//             nextTick(() => {
//                 document.getElementById('video').play()
//             })
//         }
//     } else {
//         config.imgSrc = src
//     }
//     config.isShow = true
// }
// // 关闭弹窗
// const hidePopFn = () => {
//     config.isShow = false
//     if(config.isVideo && !config.isYT) {
//         document.getElementById('video').pause()
//     }
//     config.videoScript = config.videoSrc= config.imgSrc = ''
// }

onMounted(() => {
})
</script>
<template>
    <transition name="fade">
        <div class="pf pop" v-show="homeStore.pop.popFlag">
            <div class="com-box" v-show="homeStore.pop.popNum === 0">
                <a href="javascript:;" class="pa pop-close" v-show="homeStore.pop.popFlag" @click="homeStore.handleClosePop"></a>
                <video id="video" controls :src="homeStore.pop.videoSrc"></video>
            </div>
            <div class="com-box" v-show="homeStore.pop.popNum === 1">
                <a href="javascript:;" class="pa pop-close" v-show="homeStore.pop.popFlag" @click="homeStore.handleClosePop"></a>
                <img :src="homeStore.popImgSrc" alt="">
            </div>
        </div>
    </transition>
</template>
<style lang="scss" scoped>
@import '@/assets/styles/home_pc.scss';
</style>
